<#import "../macro/components.ftl" as components/>
<#include "../macro/layout_default.ftl"/>
<@head>
<link rel="stylesheet" href="/misc/adminlte-2.3.7/plugins/daterangepicker/daterangepicker.css"/>
</@head>
<@body>
<script src="/misc/adminlte-2.3.7/plugins/daterangepicker/moment.min.js"></script>
<script src="/misc/adminlte-2.3.7/plugins/daterangepicker/daterangepicker.js"></script>
<script src="/misc/app/js/lgs_relate.js"></script>
</@body>
<@layout_default>

<div class="box">

    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">瓶箱关联</a>
        </li>
        <li role="presentation"><a href="/relateTray">托盘关联</a></li>
    </ul>

    <div class="box-header with-border">
        <input type="hidden" id="resultTotal_hidden" value="${pagelist.resultTotal}" />
        <span class="pull-right text-muted">共 ${pagelist.resultTotal} 条记录</span>
        <input type="hidden" id="cTimeS_hidden" value="${cTimeS!}" />
        <input type="hidden" id="cTimeE_hidden" value="${cTimeE!}" />
        <input type="hidden" id="depot_hidden" value="${depot!}" />
        <form class="form-inline" action="/relateBox">
            <div class="input-group">
                <div class="input-group-addon">操作时间</div>
                <input type="text" class="form-control" id="time_start" name="cTimeS" size="18">
            </div>
            <div class="input-group"> 至 </div>
            <div class="input-group">
                <input type="text" class="form-control" id="time_end" name="cTimeE" size="18">
            </div>

            <div class="input-group">
            <div class="input-group-addon">操作地点：</div>
                <select class="form-control" name="depot" id="depot">
                    <option value="">全部</option>
                    // 获取地点
                </select>
            </div>

            <div class="input-group">
            <div class="input-group-addon">操作人：</div>
                <input type="text" class="form-control" style="width: 260px" name="cAdmin" id="cAdmin" value="${cAdmin!}" />
            </div>

            <button type="submit" class="btn btn-warning"><i class="fa fa-search"></i> 查询</button>
        </form>
    </div>

    <div class="box-body">
        <table class="table table-striped table-hover">
            <tr>
                <th>ID</th>
                <#--<th>托盘码</th>-->
                <th>箱码</th>
                <th>瓶数</th>
                <th>操作节点</th>
                <th>所属公司</th>
                <th>操作时间</th>
                <th>操作人</th>
                <td>操作</td>
            </tr>
            <#if (pagelist.result?size > 0)>
                <#list pagelist.result as item>
                    <tr>
                        <td>${item.id!}</td>
                        <#--<td>${item.trayQrcode!}</td>-->
                        <td>${item.bQrcodeId!}</td>
                        <td>${item.boxNum!}</td>
                        <td>${item.depotName!}</td>
                        <td>${item.bingCompanyName!}</td>
                        <td>${item.ts?number_to_datetime}</td>
                        <td>${item.cAdmin!}</td>
                        <td>
                            <button type="button" class="btn btn-default btn-xs" name="btn_box" data-toggle="modal" data-target="#bot_detail"
                                    data-box="${item.bQrcodeId!}"  data-company="${item.companyId!}">查看</button>
                        </td>
                    </tr>
                </#list>
            <#else>
                <tr>
                    <td class="text-center text-muted" colspan="6"><i class="fa fa-info-circle"></i> 没有记录</td>
                </tr>
            </#if>
        </table>
        <table class="table table-striped table-hover">
            <tr>
                <td colspan="13" style="text-align:right;background-color:white;">
                    <a href="javascript:void(0);" id="btn_export_box"><i class="glyphicon glyphicon-save"></i> 数据导出</a>
                </td>
            </tr>
        </table>
    </div>
    <!-- /.box-body -->
    <div class="box-footer text-center">
        <@components.pagination "/relateBox?cTimeS=${cTimeS!}&cTimeE=${cTimeE!}&depot=${depot!}&cAdmin=${cAdmin!}&page=$page",pagelist.page,pagelist.pageTotal/>
    </div>

</div>



<!--===========Modals start================--->
<div class="modal" id="bot_detail" tabindex="-1">
    <div class="modal-dialog" role="document" style="width:700px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h5 class="modal-title"><i class="fa fa-plus"></i> 详情</h5>
            </div>
            <div class="modal-body">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th>产品名称</th>
                        <th>箱码</th>
                        <th>瓶码</th>
                        <th>操作节点</th>
                        <th>操作时间</th>
                        <th>操作人</th>

                    </tr>
                    </thead>
                    <tbody id="detail_model">

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

</@layout_default>